package com.springboot.frame.controller;

import com.springboot.frame.config.dds.DataSource;
import com.springboot.frame.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户控制器
 * @author Louis
 * @date Jun 17, 2019
 */
@RestController
@RequestMapping("/user/")
public class SysUserController {

    @Autowired
    private SysUserService sysUserService;


    @DataSource(value="master")
    @PostMapping(value="findAll")
    public Object findAll() {
        return sysUserService.findAll();
    }

    @DataSource(value="slave")
    @PostMapping(value="findAll2")
    public Object findAll2() {
        return sysUserService.findAll();
    }

    @DataSource(value="slave1")
    @PostMapping(value="findAll3")
    public Object findAll3() {
        return sysUserService.findAll();
    }

}
